package com.person.blog.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultBean<T> {
    private Integer code;

    private T data;

    private String msg;

    private String decription;

    public ResultBean(int code, T data, String msg) {
        this(code, data, msg, "");
    }

    ResultBean(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
        this.decription = errorCode.getDescription();
    }
    ResultBean(ErrorCode errorCode, String decription) {
        this.code = errorCode.getCode();
        this.msg = errorCode.getMsg();
        this.decription = decription;
    }


}
